﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;
using System.Collections;

namespace BUS
{
    public class User_BUS
    {
        public static User_DTO GetUsernamePassWordByUserID(int user_id)
        {
            return User_DAO.GetUsernamePassWordByUserID(user_id);
        }

        public static User_DTO GetUserInfomationByUserID(int user_id)
        {
            return User_DAO.GetUserInfomationByUserID(user_id);
        }

        public static bool UpdatePassword(User_DTO user)
        {
            return User_DAO.UpdatePassword(user);
        }

        //admin
        public static IEnumerable GetAllRole()
        {
            return User_DAO.GetAllRole();
        }

        public static IEnumerable GetAllUser()
        {
            return User_DAO.GetAllUser();
        }

        public static List<int> GetRoleUser(int userID)
        {
            return User_DAO.GetRoleUser(userID);
        }

        public static IEnumerable GetUserInRole(int roleID)
        {
            return User_DAO.GetUserInRole(roleID);
        }

        public static bool CreateUser(User_DTO user,int kiemTraCoChonRole ,int kiemTraLaNguoiTimViec, int RoleID)
        {
            return User_DAO.CreateUser(user,kiemTraCoChonRole ,kiemTraLaNguoiTimViec,RoleID);
        }

        public static bool UpdateUser(User_DTO user)
        {
            return User_DAO.UpdateUser(user);
        }

        public static bool DeleteUSer(int userID)
        {
            return User_DAO.DeleteUSer(userID);
        }

        public static bool DeleteAllRoleUser(int userID)
        {
            return User_DAO.DeleteAllRoleUser(userID);
        }

        public static bool DeleteRoleUser(int userID, int roleID)
        {
            return User_DAO.DeleteRoleUser(userID, roleID);
        }

        public static bool InsertRoleUser(int userID, int roleID)
        {
            return User_DAO.InsertRoleUser(userID, roleID);
        }

        public static bool InsertRole(string roleName, string description)
        {
            return User_DAO.InsertRole(roleName, description);
        }

        public static IEnumerable TimKiemUser(string tuKhoa)
        {
            return User_DAO.TimKiemUser(tuKhoa);
        }
    }
}
